import { EEnemy, EEnemyType, EWuxing } from "./Enum";
import { PrefabPath } from "./ResourceConfig";


//  哪些图片弄好了：
//enemy1
//enemy2
//enemy3
//enemy4 小雪球
//enemy5
//enemy6
//enemy7
//enemy8
//enemy9
//enemy10
//enemy11
//enemy12
//enemy13
//enemy14
//enemy15
//enemy16
//enemy17
//enemy18
//enemy19

//enemy21
//enemy22
//enemy23
//enemy24
//enemy25
//enemy26
export const EnemyConfig = {
    // ==========================================
    //  ID 1 - 20 : 【近战组】 (MELEE)
    //  特点：无 attackRange，必须走到墙下
    // ==========================================
    
    // --- Tier 1: 基础炮灰 (1-5) ---
    [EEnemy.Enemy1]: {
        name: "南宋降兵", // [基础步兵] 平衡
        speed: 10, hp: 100, attackSpeed: 0.8, ap: 10, dp: 5, accuracy: 0.85, evasion: 0.05,
        wuxing: EWuxing.Mu, type: EEnemyType.Humen
    },
    [EEnemy.Enemy2]: {
        name: "草原狼",   // [野兽] 急速
        speed: 18, hp: 60, attackSpeed: 1.2, ap: 12, dp: 0, accuracy: 0.7, evasion: 0.15,
        wuxing: EWuxing.Huo, type: EEnemyType.Animal
    },
    [EEnemy.Enemy3]: {
        name: "弯刀死士", // [突击] 高攻脆皮
        speed: 14, hp: 80, attackSpeed: 1.5, ap: 20, dp: 0, accuracy: 0.9, evasion: 0.1,
        wuxing: EWuxing.Huo, type: EEnemyType.Humen
    },
    [EEnemy.Enemy4]: {
        name: "西域斥候", // [侦查] 高闪避
        speed: 25, hp: 70, attackSpeed: 1.5, ap: 14, dp: 0, accuracy: 0.9, evasion: 0.35,
        wuxing: EWuxing.Shui, type: EEnemyType.Humen
    },
    [EEnemy.Enemy5]: {
        name: "长枪民兵", // [防守] 稍高攻击距离(逻辑上还是近战)
        speed: 9, hp: 90, attackSpeed: 0.7, ap: 15, dp: 5, accuracy: 0.8, evasion: 0.05,
        wuxing: EWuxing.Mu, type: EEnemyType.Humen
    },

    // --- Tier 2: 进阶兵种 (6-10) ---
    [EEnemy.Enemy6]: {
        name: "蒙古轻骑", // [骑兵] 突进
        speed: 22, hp: 110, attackSpeed: 1.0, ap: 15, dp: 10, accuracy: 0.8, evasion: 0.2,
        wuxing: EWuxing.Shui, type: EEnemyType.Humen
    },
    [EEnemy.Enemy7]: {
        name: "金国双刀手", // [输出] 双倍攻速
        speed: 12, hp: 120, attackSpeed: 2.0, ap: 12, dp: 5, accuracy: 0.85, evasion: 0.1,
        wuxing: EWuxing.Jin, type: EEnemyType.Humen
    },
    [EEnemy.Enemy8]: {
        name: "色目力士", // [半肉]
        speed: 8, hp: 160, attackSpeed: 0.6, ap: 25, dp: 10, accuracy: 0.8, evasion: 0,
        wuxing: EWuxing.Tu, type: EEnemyType.Humen
    },
    [EEnemy.Enemy9]: {
        name: "战獒",     // [野兽] 强力野兽
        speed: 20, hp: 100, attackSpeed: 1.0, ap: 18, dp: 5, accuracy: 0.8, evasion: 0.1,
        wuxing: EWuxing.Mu, type: EEnemyType.Animal
    },
    [EEnemy.Enemy10]: {
        name: "藤牌兵",   // [肉盾] 基础防守
        speed: 8, hp: 150, attackSpeed: 0.6, ap: 8, dp: 25, accuracy: 0.8, evasion: 0.05,
        wuxing: EWuxing.Mu, type: EEnemyType.Humen
    },

    // --- Tier 3: 精锐部队 (11-15) ---
    [EEnemy.Enemy11]: {
        name: "重甲步兵", // [肉盾] 进阶
        speed: 6, hp: 200, attackSpeed: 0.5, ap: 15, dp: 40, accuracy: 0.8, evasion: 0,
        wuxing: EWuxing.Jin, type: EEnemyType.Humen
    },
    [EEnemy.Enemy12]: {
        name: "怯薛宿卫", // [精锐] 攻防一体
        speed: 11, hp: 180, attackSpeed: 0.9, ap: 22, dp: 20, accuracy: 0.9, evasion: 0.1,
        wuxing: EWuxing.Tu, type: EEnemyType.Humen
    },
    [EEnemy.Enemy13]: {
        name: "波斯刺客", // [刺客] 极高爆发
        speed: 16, hp: 90, attackSpeed: 1.8, ap: 35, dp: 0, accuracy: 1.0, evasion: 0.3,
        wuxing: EWuxing.Shui, type: EEnemyType.Humen
    },
    [EEnemy.Enemy14]: {
        name: "重装骑兵", // [骑兵] 坦克型骑兵
        speed: 18, hp: 220, attackSpeed: 0.8, ap: 25, dp: 30, accuracy: 0.85, evasion: 0.05,
        wuxing: EWuxing.Jin, type: EEnemyType.Humen
    },
    [EEnemy.Enemy15]: {
        name: "狂战士",   // [狂暴] 低血高攻
        speed: 13, hp: 140, attackSpeed: 1.2, ap: 40, dp: 0, accuracy: 0.7, evasion: 0.1,
        wuxing: EWuxing.Huo, type: EEnemyType.Humen
    },

    // --- Tier 4: 禁卫军 (16-20) ---
    [EEnemy.Enemy16]: {
        name: "铁浮屠",   // [坦克] 物理克星
        speed: 5, hp: 400, attackSpeed: 0.4, ap: 30, dp: 80, accuracy: 1.0, evasion: 0,
        wuxing: EWuxing.Jin, type: EEnemyType.Humen
    },
    [EEnemy.Enemy17]: {
        name: "巨盾卫士", // [坦克] 魔法克星(土)
        speed: 5, hp: 450, attackSpeed: 0.4, ap: 20, dp: 60, accuracy: 0.8, evasion: 0,
        wuxing: EWuxing.Tu, type: EEnemyType.Humen
    },
    [EEnemy.Enemy18]: {
        name: "王帐死士", // [死士] 终极炮灰
        speed: 22, hp: 200, attackSpeed: 2.0, ap: 50, dp: 10, accuracy: 0.9, evasion: 0.2,
        wuxing: EWuxing.Huo, type: EEnemyType.Humen
    },
    [EEnemy.Enemy19]: {
        name: "百夫长",   // [领袖] 均衡强力
        speed: 12, hp: 300, attackSpeed: 1.0, ap: 35, dp: 30, accuracy: 0.95, evasion: 0.1,
        wuxing: EWuxing.Mu, type: EEnemyType.Humen
    },
    [EEnemy.Enemy20]: {
        name: "幻影剑客", // [闪避] 终极闪避
        speed: 18, hp: 150, attackSpeed: 1.5, ap: 45, dp: 5, accuracy: 1.0, evasion: 0.5,
        wuxing: EWuxing.Shui, type: EEnemyType.Humen
    },

    // ==========================================
    //  ID 21 - 25 : 【远程组】 (RANGED)
    //  特点：拥有 attackRange，会在远处停下攻击
    // ==========================================
    
    [EEnemy.Enemy21]: {
        name: "蒙古弓手", // [基础远程]
        speed: 10, hp: 80, attackSpeed: 0.8, ap: 15, dp: 0, accuracy: 0.9, evasion: 0.1,
        wuxing: EWuxing.Mu, type: EEnemyType.Humen,
        attackRange: 400, bulletPrefab: PrefabPath.Bullet1
    },
    [EEnemy.Enemy22]: {
        name: "掷斧兵",   // [中程] 破甲高伤
        speed: 9, hp: 120, attackSpeed: 0.5, ap: 35, dp: 10, accuracy: 0.8, evasion: 0.05,
        wuxing: EWuxing.Jin, type: EEnemyType.Humen,
        attackRange: 250 // 射程短
    },
    [EEnemy.Enemy23]: {
        name: "怯薛骑射", // [游骑兵] 快速远程
        speed: 18, hp: 140, attackSpeed: 1.0, ap: 20, dp: 10, accuracy: 0.85, evasion: 0.25,
        wuxing: EWuxing.Huo, type: EEnemyType.Humen,
        attackRange: 380, bulletPrefab: PrefabPath.Bullet1
    },
    [EEnemy.Enemy24]: {
        name: "黑萨满",   // [法师] 辅助/魔法
        speed: 8, hp: 110, attackSpeed: 0.6, ap: 18, dp: 15, accuracy: 1.0, evasion: 0.1,
        wuxing: EWuxing.Shui, type: EEnemyType.Humen,
        attackRange: 350, bulletPrefab: PrefabPath.Bullet1
    },
    [EEnemy.Enemy25]: {
        name: "神臂弩手", // [狙击] 射程最远
        speed: 7, hp: 90, attackSpeed: 0.4, ap: 50, dp: 5, accuracy: 1.0, evasion: 0.05,
        wuxing: EWuxing.Tu, type: EEnemyType.Humen,
        attackRange: 550, bulletPrefab: PrefabPath.Bullet1
    },

    // ==========================================
    //  ID 26 - 30 : 【工程机械】 (SIEGE)
    //  特点：移动极慢，血量极高，免疫部分负面效果(逻辑需单独处理)
    // ==========================================

    [EEnemy.Enemy26]: {
        name: "攻城冲车", // [攻城] 必须近身撞击
        speed: 4, hp: 800, attackSpeed: 0.3, ap: 100, dp: 50, accuracy: 1.0, evasion: 0,
        wuxing: EWuxing.Mu, type: EEnemyType.Machine,
        scale: 1.5 // 模型放大
    },
    [EEnemy.Enemy27]: {
        name: "重型弩炮", // [远程机械]
        speed: 3, hp: 500, attackSpeed: 0.2, ap: 150, dp: 20, accuracy: 1.0, evasion: 0,
        wuxing: EWuxing.Jin, type: EEnemyType.Machine,
        attackRange: 600, scale: 1.3, bulletPrefab: PrefabPath.Bullet1
    },
    [EEnemy.Enemy28]: {
        name: "回回炮",   // [超远程/范围] (投石车)
        speed: 2, hp: 400, attackSpeed: 0.15, ap: 200, dp: 10, accuracy: 0.7, evasion: 0,
        wuxing: EWuxing.Tu, type: EEnemyType.Machine,
        attackRange: 700, scale: 1.5
    },
    [EEnemy.Enemy29]: {
        name: "猛火油柜", // [喷火] 中距离持续伤害
        speed: 5, hp: 600, attackSpeed: 1.0, ap: 40, dp: 30, accuracy: 1.0, evasion: 0,
        wuxing: EWuxing.Huo, type: EEnemyType.Machine,
        attackRange: 200
    },
    [EEnemy.Enemy30]: {
        name: "楼车",     // [运兵车] 极高血量肉盾
        speed: 3, hp: 1200, attackSpeed: 0, ap: 0, dp: 40, accuracy: 0, evasion: 0,
        wuxing: EWuxing.Mu, type: EEnemyType.Machine,
        scale: 2.0 // 巨大
    },


    // ================= 特殊单位 =================
    [EEnemy.WoodenEnemy]: {
        name: "木桩", speed: 0, hp: 999999, ap: 0, wuxing: EWuxing.Jin
    },
    [EEnemy.Enemy_GoldCarriage]: {
        name: "运金马车", speed: 30, hp: 500, ap: 0, dp: 10, wuxing: EWuxing.Jin, type: EEnemyType.Humen, scale: 1.3
    },

    // ================= 10大 BOSS =================
    // 覆盖五行，涵盖 坦克、输出、法师、刺客、机械

    // Boss 1: [土] 坦克 - 先锋大将
    [EEnemy.Boss1]: { 
        name: "先锋大将", speed: 8, hp: 3000, ap: 50, dp: 50, wuxing: EWuxing.Tu, scale: 2.0 
    },
    // Boss 2: [金] 远程 - 神箭哲别
    [EEnemy.Boss2]: { 
        name: "神箭哲别", speed: 15, hp: 2000, ap: 80, dp: 10, wuxing: EWuxing.Jin, scale: 1.8, attackRange: 550, bulletPrefab: PrefabPath.Bullet1 
    },
    // Boss 3: [木] 巨兽 - 攻城巨象
    [EEnemy.Boss3]: { 
        name: "攻城巨象", speed: 6, hp: 6000, ap: 120, dp: 40, wuxing: EWuxing.Mu, scale: 2.5 
    },
    // Boss 4: [火] 领袖 - 蒙哥大汗
    [EEnemy.Boss4]: { 
        name: "蒙哥大汗", speed: 10, hp: 8000, ap: 150, dp: 50, wuxing: EWuxing.Huo, scale: 2.5 
    },
    // Boss 5: [水] 法师 - 通天巫师
    [EEnemy.Boss5]: { 
        name: "通天巫师", speed: 12, hp: 2500, ap: 100, dp: 20, wuxing: EWuxing.Shui, scale: 1.8, attackRange: 400, bulletPrefab: PrefabPath.Bullet1 
    },
    // Boss 6: [金] 刺客 - 金国剑圣 (高闪避高暴击)
    [EEnemy.Boss6]: { 
        name: "亡国剑圣", speed: 25, hp: 1800, ap: 200, dp: 0, wuxing: EWuxing.Jin, scale: 1.5, evasion: 0.4 
    },
    // Boss 7: [土] 机械 - 战争堡垒 (超高血量，极慢)
    [EEnemy.Boss7]: { 
        name: "战争堡垒", speed: 3, hp: 15000, ap: 80, dp: 100, wuxing: EWuxing.Tu, scale: 3.0, type: EEnemyType.Machine 
    },
    // Boss 8: [火] 远程 - 火炮将军 (AOE)
    [EEnemy.Boss8]: { 
        name: "火炮将军", speed: 5, hp: 4000, ap: 250, dp: 30, wuxing: EWuxing.Huo, scale: 2.0, attackRange: 600, type: EEnemyType.Machine 
    },
    // Boss 9: [水] 军师 - 速不台 (高频攻击，buff)
    [EEnemy.Boss9]: { 
        name: "速不台",   speed: 18, hp: 3500, ap: 90, dp: 30, wuxing: EWuxing.Shui, scale: 1.8 
    },
    // Boss 10: [全/金] 最终Boss - 长生天化身
    [EEnemy.Boss10]: { 
        name: "长生天",   speed: 20, hp: 20000, ap: 300, dp: 80, wuxing: EWuxing.Jin, scale: 3.0, evasion: 0.1 
    },
};

// 确保 Enum.ts 里定义了这些枚举值
export const enemyList: EEnemy[] = [
    EEnemy.Enemy1, EEnemy.Enemy2, EEnemy.Enemy3, EEnemy.Enemy4, EEnemy.Enemy5,
    EEnemy.Enemy6, EEnemy.Enemy7, EEnemy.Enemy8, EEnemy.Enemy9, EEnemy.Enemy10,
    EEnemy.Enemy11, EEnemy.Enemy12, EEnemy.Enemy13, EEnemy.Enemy14, EEnemy.Enemy15,
    EEnemy.Enemy16, EEnemy.Enemy17, EEnemy.Enemy18, EEnemy.Enemy19, EEnemy.Enemy20,
    EEnemy.Enemy21, EEnemy.Enemy22, EEnemy.Enemy23, EEnemy.Enemy24, EEnemy.Enemy25,
    EEnemy.Enemy26, EEnemy.Enemy27, EEnemy.Enemy28, EEnemy.Enemy29, EEnemy.Enemy30,
    EEnemy.WoodenEnemy, EEnemy.Enemy_GoldCarriage
];

export const bossList: EEnemy[] = [
    EEnemy.Boss1, EEnemy.Boss2, EEnemy.Boss3, EEnemy.Boss4, EEnemy.Boss5, 
    EEnemy.Boss6, EEnemy.Boss7, EEnemy.Boss8, EEnemy.Boss9, EEnemy.Boss10
];